#include"imitate_string.h"


void Imitate_string_test1()
{
	imitate::string s1("hello world");
	std::cout << s1.c_str() << std::endl;
	std::cout << s1.size() << std::endl;
	for (int i = 0; i < s1.size(); ++i)
	{
		s1[i]++;
		std::cout << s1[i] << " ";
	}
	std::cout << std::endl;
	const imitate::string s2("hello world");
	for (int i = 0; i < s2.size(); ++i)
	{
		std::cout << s2[i] << " ";
	}
}

void Imitate_string_test2()
{
	//imitate::string s1("hello world");
	//imitate::string::iterator it = s1.begin();
	//for (it; it != s1.end(); ++it)
	//{
	//	std::cout << *it << std::endl;
	//}
	//s1.reverse(100);
	//s1.push_back('c');
	//for (auto ch : s1)
	//{
	//	std::cout << ch << std::endl;
	//}
	//imitate::string s1("hello world");
	//s1.append("xx");
	//std::cout << s1.c_str() << std::endl;
	//imitate::string s1("hello world");
	//s1.insert(5, "12345");
	//std::cout << s1.c_str() << std::endl;
	//imitate::string s1("hello world");
	//s1.erase(5);
	//std::cout << s1.c_str() << std::endl;
	//imitate::string s1("hello world");
	//s1.erase(5,2);
	//std::cout << s1.c_str() << std::endl;
	//imitate::string s1("hello world");
	//size_t pos = s1.find('l');
	//std::cout << pos << std::endl;

}

void Imitate_string_test3()
{
	//imitate::string s1("hello world");
	//s1.resize(7);
	//std::cout << s1.c_str() << std::endl;
	//s1.resize(15);
	//std::cout << s1.c_str() << std::endl;
	//s1.resize(18, 'x');
	//std::cout << s1.c_str() << std::endl;
	//std::cout << s1 << std::endl;
	imitate::string s1;
	//std::cin >> s1;
	//std::cout << s1 << std::endl;
	std::cin >> s1;
	std::cout << s1 << std::endl;
}

void Imitate_string_test4()
{
	imitate::string s1("hello");
	imitate::string s2("hello");
	std::cout << (s1 < s2) << std::endl;
	std::cout << (s1 > s2) << std::endl;
	std::cout << (s1 == s2) << std::endl;
	std::cout << std::endl;
	imitate::string s3("helloxxx");
	imitate::string s4("hello");
	std::cout << (s3 < s4) << std::endl;
	std::cout << (s3 > s4) << std::endl;
	std::cout << (s3 == s4) << std::endl;
	std::cout << std::endl;
	imitate::string s5("hello");
	imitate::string s6("helloxxx");
	std::cout << (s5 < s6) << std::endl;
	std::cout << (s5 > s6) << std::endl;
	std::cout << (s5 == s6) << std::endl;
	std::cout << std::endl;
}

void Imitate_string_test5()
{
	//imitate::string s1("hello world");
	//imitate::string s2(s1);
	imitate::string s1("hello world");
	imitate::string s2("xxxxxxxxxxx");
	s1 = s2;
}

int main()
{
	Imitate_string_test5();
	return 0;
}